﻿using System;
using nRoute.Components.Composition;
using nRoute.Utilities;
using nRoute.ViewModels;

namespace nRoute.Mapping
{
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)]
    public class ResolveViewModelAttribute
        : ResolveResourceAttribute
    {
        private readonly Type _viewType;

        public ResolveViewModelAttribute(Type viewType) 
            : base(typeof(IViewModelProvider), viewType.FullName)
        {
            Guard.ArgumentNotNull(viewType, "viewType");
            _viewType = viewType;
        }

#region Properties

        public Type ViewType
        {
            get { return _viewType; }
        }

#endregion

    }
}
